15 / 16

What is the difference between `fs.unlink()` and `fs.unlinkSync()` in Node.js?

  1. 1

    fs.unlink() is an asynchronous method for deleting files. It takes a callback function to handle the result.

  2. 2

    fs.unlinkSync() is a synchronous method for deleting files. It blocks the execution until the file is deleted.